﻿using System;
using Moonlite.UI.Shell.Controls;

namespace Moonlite.Data.Configuration.Implementation
{
    internal sealed class MoonliteGeneralConfigurationElement : ConfigurationElement
    {
        public static readonly Type Type = typeof(MoonliteGeneralConfigurationElement);

        private bool showSplashScreen;
        private string theme;
        private bool closeStartPageOnProjectLoad;
        private bool showStartPageOnStartup;

        public override string Name
        {
            get { return "General"; }
        }

        [ConfigurationProperty(true, typeof(Shell), "ShowSplashScreen")]
        public bool ShowSplashScreen
        {
            get { return showSplashScreen; }
            set
            {
                showSplashScreen = value;
                RaisePropertyChangedEvent("ShowSplashScreen");
            }
        }

        [ConfigurationProperty("Office 2010 Blue", typeof(Shell), "Theme")]
        public string Theme
        {
            get { return theme; }
            set
            {
                theme = value;
                RaisePropertyChangedEvent("Theme");
            }
        }

        [ConfigurationProperty(true, typeof(StartPage), "ClosePageOnProjectLoad")]
        public bool CloseStartPageOnProjectLoad
        {
            get { return closeStartPageOnProjectLoad; }
            set
            {
                closeStartPageOnProjectLoad = value;
                RaisePropertyChangedEvent("CloseStartPageOnProjectLoad");
            }
        }

        [ConfigurationProperty(true, typeof(StartPage), "ShowPageOnStartup")]
        public bool ShowStartPageOnStartup
        {
            get { return showStartPageOnStartup; }
            set
            {
                showStartPageOnStartup = value;
                RaisePropertyChangedEvent("ShowStartPageOnStartup");
            }
        }
    }
}
